Skip to content

Add new statistics#683

Merged
chernishev merged 1 commit intoDesbordante:mainfrom
karinaA7:add-new-statistics
Mar 13, 2026
Merged

Add new statistics#683
chernishev merged 1 commit intoDesbordante:mainfrom
karinaA7:add-new-statistics

Conversation

@karinaA7
Copy link
Copy Markdown
Contributor

@karinaA7 karinaA7 commented Feb 25, 2026

New statistics:

whitespaceOnlyCount - the number of lines that consist only of whitespace characters
(space and tab)

firstCharFrequency / lastCharFrequency - the most common first/ last character in the column lines and the number of its occurrences

leadingWhitespaceCount / trailingWhitespaceCount - the number of lines with spaces at the beginning or at the end

specialCharsCount
Number of lines containing special characters

@xJoskiy
Copy link
Copy Markdown
Collaborator

xJoskiy commented Feb 26, 2026

Since you've added new statistic methods to DataStats, they are now printed whenever data_stats.get_all_statistics_as_string() is called in data_stats.py. So in order to pass CI you may copy output of data_stats.py into corresponding snapshot in snap_test_examples_pytest.py

@karinaA7 karinaA7 force-pushed the add-new-statistics branch 2 times, most recently from 9dab0de to 742d809 Compare February 28, 2026 10:21
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@xJoskiy xJoskiy self-assigned this Feb 28, 2026
@karinaA7 karinaA7 force-pushed the add-new-statistics branch from c5b7a1b to 03a3e42 Compare March 2, 2026 15:36
@karinaA7 karinaA7 force-pushed the add-new-statistics branch from 03a3e42 to b52df00 Compare March 3, 2026 16:07
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@karinaA7 karinaA7 force-pushed the add-new-statistics branch from b52df00 to fe1f418 Compare March 3, 2026 16:27
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@karinaA7 karinaA7 force-pushed the add-new-statistics branch 2 times, most recently from 9237253 to d848454 Compare March 3, 2026 20:33
@karinaA7 karinaA7 force-pushed the add-new-statistics branch from d848454 to 0e8419f Compare March 5, 2026 11:07
return GetWhitespaceCount(index, CharPosition::kLast);
}

Statistic DataStats::GetSpecialCharsCount(size_t index) const {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming does not reflect the actual purpose of this function. Should better name it like GetNumberOfRowsWithSpecialChars

Comment on lines +923 to +927
Statistic DataStats::GetLeadingWhitespaceCount(size_t index) const {
return GetWhitespaceCount(index, CharPosition::kFirst);
}

Statistic DataStats::GetTrailingWhitespaceCount(size_t index) const {
Copy link
Copy Markdown
Collaborator

@xJoskiy xJoskiy Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same with these functions. GetNumberOfRowsWithTrailingWhitespaces

@xJoskiy
Copy link
Copy Markdown
Collaborator

xJoskiy commented Mar 8, 2026

Also it is highly recommended to resolve conversations when issues are fixed

@karinaA7 karinaA7 force-pushed the add-new-statistics branch 2 times, most recently from dfbf804 to 1d58d0b Compare March 8, 2026 15:59
@xJoskiy
Copy link
Copy Markdown
Collaborator

xJoskiy commented Mar 12, 2026

LGTM

@chernishev chernishev merged commit 4ec2229 into Desbordante:main Mar 13, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants